package com.swjd.utpchat;

import java.net.DatagramSocket;
import java.net.SocketException;
import java.util.Scanner;

public class View {
public static void main(String[] args) throws SocketException {
	Scanner sc = new Scanner(System.in);
	System.out.println("请输入当前程序的端口号：");
	int myPort = sc.nextInt();
	System.out.println("请输入您要绑定的对方端口：");
	int sendPort = sc.nextInt();
	System.out.println("聊天系统初始化完成并启动！！！");
	//1.创建socket码头对象
	DatagramSocket socket = new DatagramSocket(myPort);
	//2.开启两条线程
	//2.1发送端线程
	new Thread(new SendSocket(socket,sendPort)).start();
	//2.2接收端线程
	new Thread(new ReveiceSocket(socket)).start();
}
}
